<template>
  <div>
     <form @submit.prevent='log'>
        <input type="text" name="username" v-model.lazy.trim="form.username">

        <input type="text" name="password" v-model.number.trim="form.password">

        <button >提交</button>
    </form>
   </div>
</template>
 
<script>
export default {
  //data
  data() {
    return {
        msg:'杭州的第一场雪',
        form:{
            username:'',
            password:''
        }
    };
  },
  methods: {
    log(){
      console.log(this.form.username);
      console.log(this.form.password);
    }
  }
};
</script>

<style scoped>
     
</style>